package mysql

import "gorm.io/gorm"

type TikTok struct {
	gorm.Model
	Name   string  `gorm:"type:varchar(30);not null"`
	Status string  `gorm:"type:varchar(30);not null"`
	Stock  int64   `gorm:"type:int(11);not null"`
	Price  float64 `gorm:"type:decimal(10,2);not null"`
	Cover  string  `gorm:"type:varchar(255);not null"`
}

func (t *TikTok) Create() error {
	return DB.Create(&t).Error
}
func (t *TikTok) GetInfo(TikTokId int64) error {
	return DB.Where("id = ?", TikTokId).Limit(1).Find(&t).Error
}
